export function getCount(count) {
  if (count < 0) return;
  if (count < 10000) {
    return count;
  } else if (Math.floor(count / 10000) < 10000) {
    return Math.floor(count / 1000) / 10 + "万";
  } else {
    return Math.floor(count / 10000000) / 10 + "亿";
  }
}

export function getPlaySong(id) {
  return `https://music.163.com/song/media/outer/url?id=${id}.mp3`;
}


// 格式化评论
export function formattingComments(comments) {
  comments.forEach(item => {
    item.huifu = []
  })
  // 二级评论
  let huifuOthers = comments.filter((item, index) => {
    // item.huifu = []
    return item.parentCommentId != 0
  })
  // console.log('huifuOthers', huifuOthers);
  huifuOthers.forEach(item => {
    // let huifu = []
    comments.forEach(commentsItem => {
      if (commentsItem.commentId == item.parentCommentId) {
        // console.log('父级',comments,'子集',item);
        // huifu.push(item)
        commentsItem.huifu.push(item)
        // console.log(huifu);
      }

    })
  })
  return comments
}

export function xingzuo(month, date) {
  let value = ''
  if (month == '01' && date >= 20 || month == '02' && date <= 18) {
    value = "水瓶座";
  }
  0
  if (month == '01' && date > 31) {
    value = "Huh?";
  }
  0
  if (month == '02' && date >= 19 || month == '03' && date <= 20) {
    value = "双鱼座";
  }
  0
  if (month == '02' && date > 29) {
    value = "Say what?";
  }
  0
  if (month == '03' && date >= 21 || month == '04' && date <= 19) {
    value = "白羊座";
  }
  0
  if (month == '03' && date > 31) {
    value = "OK. Whatever.";
  }
  0
  if (month == '04' && date >= 20 || month == '05' && date <= 20) {
    value = "金牛座";
  }
  0
  if (month == '04' && date > 30) {
    value = "I'm soooo sorry!";
  }
  0
  if (month == '05' && date >= 21 || month == '06' && date <= 21) {
    value = "双子座";
  }
  0
  if (month == '05' && date > 31) {
    value = "Umm ... no.";
  }
  0
  if (month == '06' && date >= 22 || month == '07' && date <= 22) {
    value = "巨蟹座";
  }
  0
  if (month == '06' && date > 30) {
    value = "Sorry.";
  }
  0
  if (month == '07' && date >= 23 || month == '08' && date <= 22) {
    value = "狮子座";
  }
  0
  if (month == '07' && date > 31) {
    value = "Excuse me?";
  }
  0
  if (month == '08' && date >= 23 || month == '09' && date <= 22) {
    value = "处女座";
  }
  0
  if (month == '08' && date > 31) {
    value = "Yeah. Right.";
  }
  0
  if (month == '09' && date >= 23 || month == '10' && date <= 22) {
    value = "天秤座";
  }
  0
  if (month == '09' && date > 30) {
    value = "Try Again.";
  }
  if (month == 10 && date >= 23 || month == 11 && date <= 21) {
    value = "天蝎座";
  }
  if (month == 10 && date > 31) {
    value = "Forget it!";
  }
  if (month == 11 && date >= 22 || month == 12 && date <= 21) {
    value = "射手座";
  }
  if (month == 11 && date > 30) {
    value = "Invalid Date";
  }
  if (month == 12 && date >= 22 || month == '01' && date <= 19) {
    value = "摩羯座";
  }
  if (month == 12 && date > 31) {
    value = "No way!";
  }
  return value
}